#include <QCoreApplication>
#include <QDebug>
#include "mytcpserver.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    MyTcpServer server;

    // 启动服务器，让它在 8888 端口上监听
    if (!server.listen(QHostAddress::Any, 8888)) {
        qDebug() << "Server could not start!";
        qDebug() << "Error:" << server.errorString();
        return 1;
    }

    qDebug() << "Server started on port 8888. Waiting for connections...";


    return a.exec();
}
